<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String servers=request.getScheme()+"://"+request.getServerName();
//String serverss="http://192.168.0.10:8099";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>日常监管</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basePath }style/default.css">
<script type="text/javascript" src="${basePath }setpentaho/SetAddress.js" >
</script>
	<script type="text/javascript">
	document.domain = pentaho_address;
	var treeId;
	var treeName;
	var treeType="type";
	var treeData;
	function init() {
		addMenu();	
		//预加载
		$("#title").show();
		$("#title").html("<center>食品生产-检查主体统计</center>");
		$("#title").find("center").css("font-size","18px")
		$("#rcjgiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=rcjgsc1.wcdf&userid=admin&password=password");
	}
	//加载树数据
	function addMenu() {
		
		var content1=["1","0","日常监管","type"];//1级别
		//生产
		var content2=["2","1","食品生产日常监管","type2"];//2级别
		var contents1=["sc1","2","指标分析","type3"];//3级别
		var contentss1=["sc11","sc1","检查主体数","scpage1"];//4级别
		var contentss2=["sc12","sc1","检查主体违规率","scpage11"];//4级别
		var contents2=["sc2","2","多维分析","type3"];//3级别
		var contentss3=["sc21","sc2","生产日常监管情况","scpage2"];//4级别
		var contents3=["sc3","2","统计分析","type3"];//3级别
		var contentss4=["sc31","sc3","生产日常监管情况","scpage3"];//4级别
		//经营
		var content3=["3","1","食品经营日常监管","type2"];//2级别
		var contentj1=["jy1","3","指标分析","type3"];//3级别
		var contentjs1=["jy11","jy1","检查评级主体数","jypage1"];//4级别
		var contentjs2=["jy12","jy1","检查主体覆盖率","jypage11"];//4级别
		var contentj2=["jy2","3","多维分析","type3"];//3级别
		var contentjs3=["jy21","jy2","经营日常监管情况","jypage2"];//4级别
		var contentj3=["jy3","3","统计分析","type3"];//3级别
		var contentjs4=["jy31","jy3","经营日常监管情况","jypage3"];//4级别
		var content4=["4","1","其他","typeqita"];//2级别
		var contentq1=["qiyehuaxiang","4","企业画像","qiyehuaxiang"];//3级别
		var contentsinfo={code:"0",status:true,content:[content1,content2,content3,content4,
		                                                contents1,contents2,contents3,contentj1,contentj2,contentj3,
		                                                contentss1,contentss2,contentss3,contentss4,
		                                                contentjs1,contentjs2,contentjs3,contentjs4,
		                                                contentq1
		                                                ]};
		console.log(contentsinfo.content);
		//设置树的数据
		treeData=contentsinfo.content;
		getTree().parse(contentsinfo.content, "jsarray");
		getTree().openItem("1");
		getTree().selectItem("1");
	}
	//点击树形的时候获得相应的数据
	function onSelect(id, name, pid) {
		treeId = id;//树形上的id
		treeName = name;//树形的名字
		queryTreeType();
		console.log(treeType)
		if(treeType == "scpage1") {
			$("#title").show();
			$("#title").html("<center>食品生产-检查主体统计</center>");
			$("#rcjgiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=rcjgsc1.wcdf&userid=admin&password=password");
		}else if(treeType == "scpage11") {
			$("#title").show();
			$("#title").html("<center>食品生产-违规率</center>");
			$("#rcjgiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=rcjgsc.wcdf&userid=admin&password=password");
		}else  if(treeType == "scpage2") {
			$("#title").show();
			$("#title").html("<center>食品生产日常监管多维分析情况</center>");
	    	$("#rcjgiframe").attr("src", "/GX_IRAP/ztpage.jsp?query=rcjg-sc");
	    }else  if(treeType == "scpage3") {
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#rcjgiframe").attr("src", "/GX_IRAP/page/bi/rcjg/torcjgsc");
	    }else if(treeType == "jypage1") {
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#rcjgiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=rcjgjy1.wcdf&userid=admin&password=password");
	    }else if(treeType == "jypage11") {
	    	$("#title").show();
	    	$("#title").html("<center>食品餐饮服务提供者-日常监管覆盖情况</center>");
	    	$("#rcjgiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=rcjgjy.wcdf&userid=admin&password=password");
	    }else if(treeType == "jypage2") {
	    	$("#title").show();
	    	$("#title").html("<center>食品经营日常监管多维分析情况</center>");
	    	$("#rcjgiframe").attr("src", "/GX_IRAP/ztpage.jsp?query=rcjg-jy");
	    }else if(treeType == "jypage3") {
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#rcjgiframe").attr("src", "/GX_IRAP/page/bi/rcjg/torcjgjy");
	    }else if(treeType == "qiyehuaxiang") {
	    	$("#title").html("<center>企业画像</center>");
	    	$("#title").hide();
	    	$("#rcjgiframe").attr("src", "/GX_IRAP/entp/entp.jsp");
	    }
		$("#title").find("center").css("font-size","18px")
		//query(treeId);//调用此方法查询相应的数据
	}
	function queryTreeType(){
		for (var i in treeData){
			
			
			if(treeData[i][0] == treeId){
				treeType = treeData[i][3];
			}
		}
	}
	
	</script>
<style type="text/css">
  br {
    clear: both;
  }
</style>
  </head>
  
  <body onload="init()" style="margin: 0;" margin-top="0">
    <div style="display: flex;height:auto">
    <!-- 左边的div -->
     <div style="height: 100%;overflow: auto;width: 250px;border-right:1px solid #ccc">
					<jsp:include page="/common/tree.jsp">
						<jsp:param value="getTree" name="getTree" />
						<jsp:param value="false" name="isCheck" />
						<jsp:param value="onSelect" name="onSelect" />
					</jsp:include>
	</div>
    <!-- 右边的div -->
    
    <div style="overflow:auto;width:auto;flex: 1;">
    <!-- div里面的自适应分块像田字块 -->
      <div id="title" style="margin-top: 10px;text-align:center">  </div>
     	<iframe id="rcjgiframe" src="" width="100%" height="90%" style="text-align: center;border:none;padding:0 30px"></iframe>
       
      <!-- 
      <div style="text-align: center;">
      <div style="display: inline-block;width:47%;height: 350px;border:solid 1px rgba(0, 179, 255, 0.62);margin-right:10px;min-width: 350px;border-radius: 10px"></div>  
      <div style="display: inline-block;width:47%;height: 350px;border:solid 1px rgba(0, 179, 255, 0.62);margin-left:10px;;min-width: 350px;border-radius: 10px"></div> 
      </div>
       -->
    </div>
    
    </div>
  </body>
</html>
